package com.dharma.mydiet.view;

import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.model.TimeSeries;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.renderer.XYMultipleSeriesRenderer;
import org.achartengine.renderer.XYSeriesRenderer;

import android.content.Context;
import android.content.Intent;

public class GraphicRegister {
    
    public GraphicalView getView(Context context, TimeSeries serie) {
	
	XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
	dataset.addSeries(serie);
	XYMultipleSeriesRenderer mRendered = new XYMultipleSeriesRenderer();
	XYSeriesRenderer renderer = new XYSeriesRenderer();
	mRendered.addSeriesRenderer(renderer);
	
	return ChartFactory.getLineChartView(context, dataset, mRendered);
    }
}
